//
//  NoDataView.m
//  pmm
//
//  Created by WTFSSD on 2017/7/28.
//  Copyright © 2017年 WTFSSD. All rights reserved.
//

#import "NoDataView.h"

#import "DesignAbleImageView.h"

@interface NoDataView()
@property(nonatomic,strong)DesignAbleImageView * imageView;

@property(nonatomic,strong)UILabel * textLabel;
@end

@implementation NoDataView


-(void)initSubView{
    DesignAbleImageView * imageView = [[DesignAbleImageView alloc] initWithFrame:CGRectZero];
    [self addSubview:imageView];
    self.imageView = imageView;
    
    
    UILabel * textLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    textLabel.textAlignment = NSTextAlignmentCenter;
    textLabel.textColor = [UIColor blackColor];
    textLabel.font = [UIFont systemFontOfSize:17];
    [self addSubview:textLabel];
    self.textLabel = textLabel;
    
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.centerY.equalTo(self.mas_centerY).offset(-10);
        make.width.height.equalTo(self.mas_width).multipliedBy(0.5);
    }];
    
    [textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(imageView.mas_bottom).offset(10);
    }];
}

-(void)setImage:(UIImage *)image{
    self.imageView.image = image;
}

-(void)setImageCornerRadius:(NSString *)imageCornerRadius{
    self.imageView.cornerRadius = imageCornerRadius;
}


-(void)setText:(NSString *)text{
    self.textLabel.text = text;
    [self.textLabel sizeToFit];
}
-(void)setTextColor:(UIColor *)textColor{
    self.textLabel.textColor = textColor;
}

-(void)setFontSize:(CGFloat)fontSize{
    self.textLabel.font = [UIFont systemFontOfSize:fontSize];
    [self.textLabel sizeToFit];
}

@end
